package com.levy.jituan;

import java.util.ArrayDeque;
import java.util.Queue;

/**
 * Created by levy on 2019/6/27.
 */
public class DataQueue {

    private Queue<Company> queue = new ArrayDeque<>();

    public Queue getQueue() {
        return queue;
    }

    public void setQueue(Queue queue) {
        this.queue = queue;
    }

    public synchronized Company getOneCompany() {
        Company s = null;
        if (this.queue.size() > 0) {
            s = this.queue.poll();
        }
        return s;
    }

    public synchronized int getQueueSize(){
        return this.queue.size();
    }
}
